﻿<%@ Page Title="" Language="VB" MasterPageFile="MasterPage.master" AutoEventWireup="false"
    CodeFile="portal.aspx.vb" Inherits="driver_portal" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<h1>Welcome <% response.Write(Session("first_name")) %>! </h1>
<h2><center>Upcoming Drives</center></h2>
    <div class="center-me-portal">
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:serviceConnectionString %>" >
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1" 
            AutoGenerateColumns="False" EnableModelValidation="True" CellPadding="5" AllowSorting="True" CssClass="awesome-gridview" >
            <Columns>
                <asp:BoundField DataField="activity-name" HeaderText="Activity" SortExpression="activity-name" />
                <asp:BoundField DataField="Date" HeaderText="Date" DataFormatString="{0:MMMM dd, yyyy}" SortExpression="Date" />
                
                <asp:TemplateField HeaderText="Start with travel" SortExpression="begin_time">
                            <ItemTemplate>
                               <asp:Label ID="begin_time_wtrav" Text='<%# string.Format("{0:h:mm tt}",Eval("begin_time").AddMinutes(-(Eval("travel_time")))) %>'  runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                <asp:TemplateField HeaderText="End with travel" SortExpression="end_time">
                            <ItemTemplate>
                               <asp:Label ID="end_time_wtrav" Text='<%# string.Format("{0:h:mm tt}",Eval("end_time").AddMinutes((Eval("travel_time"))))  %>'  runat="server" />
                            </ItemTemplate>
                        </asp:TemplateField>

                <asp:BoundField DataField="Notes" HeaderText="Notes" SortExpression="Notes" />
            </Columns> 
                          
        </asp:GridView>
    </div>
</asp:Content>
